package com.sealer.pattern.behavioral.visitor;

/**
 * Created by sealer on 17/04/09.
 */
public class Car implements CarElement {

    private CarElement[] carElements;

    public Car() {
        this.carElements = new CarElement[]{
                new Wheel("front left"), new Wheel("front right"),
                new Wheel("back left"), new Wheel("back right"),
                new Body(), new Engine()
        };
    }

    @Override
    public void accept(CarElementVisitor carElementVisitor) {
        for (CarElement carElement :
                carElements) {
            carElement.accept(carElementVisitor);
        }
    }
}
